<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../jquery/jquery-3.6.0.js"></script>
</head>
<body>
    <input type="text" value="Hello world"><br />
    <button>激活input域的select事件</button>
    <script>
        $("input").select(function(){
            $("input").after("文本被选中！");
        })
        var e = jQuery.Event("select");
        $("button").click(function(){
            $("input").trigger(e);
        })
    </script>
</body>
</html>